import App from './App'
import { createPinia } from 'pinia';

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
// 只在 H5 平台使用 ElementUI
// #ifdef H5
// #endif

Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'// 引入 Element Plus 样式
import locale from 'element-plus/es/locale/lang/zh-cn'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// 创建 Pinia 实例
const pinia = createPinia();
export function createApp() {
  const app = createSSRApp(App)
  for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }
  app.use(ElementPlus, { locale });
  app.use(pinia);
  return {
    app
  }
}
// #endif